<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var str1 = 'Hello JS and Java';
        console.log(str1.indexOf('J'));//6
        console.log(str1.indexOf('JS'));//6
        console.log(str1.indexOf('JS', 9));//-1
        var str2 = 'how are you doing today';
        var array = str2.split(' ');
        console.log(array);//['how', 'are', 'you', 'doing', 'today']
        console.log(array[0]);//how
        // "".isEmpty()  true
        // "abc".isEmpty()  false
        console.log('1:2:3:4'.split(':'));//['1', '2', '3', '4']

        console.log('-----------------')
        if (true) {
            console.log('true');
        }
        if (0) {//false
            console.log('0');
        }
        if (!0) {//true
            console.log('!0');
        }
        if ('') {//false
            console.log('空字符串');
        }
        if ('abc') {//true
            console.log('abc');
        }

    </script>
</head>
<body>

</body>
</html>